package com.gxgeek.javabasic.redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * Created by gx on 2017/7/7.
 */
public class RedisUtil {
//    private static JedisPool jedisPool = new JedisPool(new JedisPoolConfig(),"localhost",6379);

    public static Jedis getJedis() {
        JedisPool jedisPool = new JedisPool(new JedisPoolConfig(),"localhost",6379);
        return jedisPool.getResource();
    }

    public static void returnResource(Jedis jedis) {
        jedis.close();
    }
}
